
//Vue3框架提供的createApp,可以用来创建应用实例方法
import { createApp } from 'vue'

//引入根组件App
// import App from './App.vue'
//vite使用的是ts，ts不识别.vue 需要在在vite项目的根 vite-env.d.ts 文件中添加对应配置
import App from '@/App.vue'
//引入清除默认样式
import "@/style/reset.scss"
//引入vue-router核心插件
import router from "@/router/index.ts";
//引入ElementPlus插件和样式与国际化文件
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
//@ts-ignore //忽略ts校验避免 zh-com.mjs 文件报错
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
//引入Pinia仓库
import pinia from "@/store/index.ts";
//引入全局组件顶部和底部
import HospitalTop from "@/components/hospital_top/index.vue";
import HospitalBottom from "@/components/hospital_bottom/index.vue";
import Login from "@/components/login/index.vue";
import Visitor from "@/components/visitor/visitor.vue"

//引入路由鉴权
import "@/router/permission.ts"

//利用createApp方法传入根组件创建应用实例,并将应用实例挂载到#app
const app = createApp(App);
//安装vue-router插件
app.use(router);
//安装Pinia
app.use(pinia);
//安装ElementPlus插件并应用国际化功能
app.use(ElementPlus,{locale: zhCn});
//安装注册全局组件
app.component("HospitalTop",HospitalTop);
app.component("HospitalBottom",HospitalBottom);
app.component("Login", Login);
app.component("Visitor", Visitor);

//挂载Vue实例到index.html的id为app的元素上面
app.mount('#app')
